<!DOCTYPE html">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


<script type="text/javascript">
  var session_id = "${Session.id!0}";
  var basePath = "${basePath}";
  //编辑器上传文件
  var kindeditor_option_uploadJson = basePath+"/restful/file/uploadFile.shtml";
  var kindeditor_option_fileManagerJson = basePath+"/restful/file/uploadFile.shtml";
  //网页上传图片
  var webuploader_server = basePath+"/restful/file/upload.shtml";
  //多图片上传功能中单个图片大小限制
  var kindeditor_option_imageSizeLimit = "2MB";
  //修改部分kindeditor默认配置
  function kind_editor_def_options(options) {
    function _undef(val, defaultVal) {
        return val === undefined ? defaultVal : val;
    }
    options = options || {};
    //options.debug = _undef(options.debug, true);
    options.resizeType = _undef(options.resizeType, 1)
    options.allowFlashUpload = _undef(options.allowFlashUpload, false)
    options.allowMediaUpload = _undef(options.allowMediaUpload, false)
    options.allowFileUpload = _undef(options.allowFileUpload, false)
    options.allowImageUpload = _undef(options.allowImageUpload, true)
    options.allowFileManager = _undef(options.allowFileManager, true)
    options.filterMode = _undef(options.filterMode, false);//true时根据 htmlTags 过滤HTML代码，false时允许输入任何代码。
    options.uploadJson = _undef(options.uploadJson, kindeditor_option_uploadJson)
    options.fileManagerJson = _undef(options.fileManagerJson, kindeditor_option_fileManagerJson)
    options.extraFileUploadParams = options.extraFileUploadParams
    options.imageSizeLimit = _undef(options.imageSizeLimit, kindeditor_option_imageSizeLimit)
    options.imageUploadLimit = _undef(options.imageUploadLimit, 20)
    options.items = _undef(options.items, [
                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                /*'flash', 'media',*/ 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                'anchor', 'link', 'unlink', '|', 'about'
        ]);
    if(options.extraFileUploadParams) {
        if(typeof(options.extraFileUploadParams) == 'object') {
            options.extraFileUploadParams.session_id = session_id;//session_id swfupload在firefox下未能获取session
        } else {
            options.extraFileUploadParams += '&session_id='+session_id;
        }
    } else {
        options.extraFileUploadParams = {session_id: session_id};
    }
    options.afterBlur = _undef(options.afterBlur, function(){this.sync();}); 
    return options;
  }
  
  var kind_editor_option = {
    resizeType : 1,
    allowFlashUpload: false,
    allowMediaUpload: false,
    allowFileUpload: false,
    allowImageUpload: true,
    allowFileManager: true,
    uploadJson: kindeditor_option_uploadJson,
    extraFileUploadParams: {session_id: session_id},//session_id swfupload在firefox下未能获取session
    imageSizeLimit: kindeditor_option_imageSizeLimit,
    imageUploadLimit: 20,
    items: [
            'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
            /*'flash', 'media',*/ 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
            'anchor', 'link', 'unlink', '|', 'about'
    ],
    afterBlur: function(){this.sync();}
  };

  var kind_editor_simple_option = {
      resizeType : 1,
      allowFlashUpload: false,
      allowMediaUpload: false,
      allowFileUpload: false,
      allowImageUpload: false,
      allowFileManager: false,
      allowPreviewEmoticons : false,
      allowImageUpload : false,
      items : [
               'source','undo','plainpaste','wordpaste','clearhtml','quickformat','selectall','fullscreen','fontname','fontsize',
               'subscript','superscript','indent','outdent','|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','hr'
      ],
      afterBlur: function(){this.sync();}
  }

  //图片上传模块配置
  var kind_editor_option_image = {
      uploadJson: kindeditor_option_uploadJson,
      allowFileManager:true,
  }
</script>
<link rel="stylesheet" href="${basePath}/css/upload.css" />

<link rel="stylesheet" href="${basePath}/plugins/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="${basePath}/plugins/kindeditor/plugins/code/prettify.css" />
<script src="${basePath}/plugins/kindeditor/kindeditor.js?v=201711031828"></script>
<script src="${basePath}/plugins/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" src="${basePath}/plugins/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript" src="${basePath}/plugins/kindeditor/plugins/image/image.js"></script>
</head>
</html>